package com.jiyang.jyandroid.test01;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.jiyang.jyandroid.R;

/**
 * Created by jy on 2016/10/24.
 * 基于ListActivity的list
 */

public class Test01_listActivity extends ListActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ListView listView = getListView();
        TextView textView = new TextView(this);
        textView.setText("使用资源数组和ListActivity展现");
        listView.addHeaderView(textView);
        ArrayAdapter<String> arrayAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_multiple_choice, getResources().getStringArray(R.array.test_names));
        setListAdapter(arrayAdapter);
    }
}
